<%@page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tags.tld" prefix="s"%>
<%@taglib uri="/WEB-INF/dianning.tld" prefix="dianning"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title><dianning:webinfo type="area"/>二手房|<dianning:webinfo type="area"/>二手房信息<dianning:webinfo type="poweredby"/></title>
<meta name="description" content="<dianning:webinfo type="area"/>二手房网为您提供最新、最真实的<dianning:webinfo type="area"/>二手房个人信息,<dianning:webinfo type="area"/>二手房经纪人信息。 "/>
<meta name="keywords" content="<dianning:webinfo type="area"/>二手房,<dianning:webinfo type="area"/>二手房信息"/> 
<link href="/css/top.css" rel="stylesheet" type="text/css" />
<link href="/css/foot.css" rel="stylesheet" type="text/css" />
<link href="/css/post.css" rel="stylesheet" type="text/css" />
<link href="/css/validator.css" rel="stylesheet" type="text/css" />
<link href="/css/photoupload.css" rel="stylesheet" type="text/css" />
<link href="/css/jquery.wysiwyg.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" charset="utf-8" src="/js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/autoresize.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/jquery_last.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/formValidator.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/formValidatorRegex.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/photoupload.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/jquery.wysiwyg.js"></script>
<script type="text/javascript" charset="utf-8" src="/js/nicEdit-latest.js"></script>
</head>

<body>
<div class="bgtop">
<s:include value="/top.jsp" />
</div>
<div class="content">
<UL id=navbar>
  <LI><I>1</I><s:property value="bigChannel.channel.channelName"/></LI>
  <LI><I>2</I><s:property value="smallChannel.channel.channelName"/></LI>
<s:if test="areaId==0">
   <LI><I>3</I><dianning:webinfo type="area"/></LI>
</s:if>
<s:else>
  <LI><I>3</I><s:property value="area.areaname"/></LI>
</s:else>
<s:if test="tid==0">
<s:if test="areaId==0">
  <LI><I>4</I><a><dianning:webinfo type="area"/></a></LI>
</s:if>
<s:else>
  <LI><I>4</I><s:property value="area.areaname"/></LI>
</s:else>
</s:if>
<s:else>
  <LI><I>4</I><s:property value="tradingArea.tradingname"/></LI>
</s:else>
  <LI class=active><I>5</I>填写信息</LI></UL></DIV>	
<div class="content">

<ul class="pub_mainmnu  minheight">                                                                    
<form name="update" id="update" method="post" action="/house/ershoufang.action">
<s:hidden name="action"/>
<s:hidden name="id"/>
<s:hidden name="bid" />
<s:hidden name="sid" />
<s:hidden name="areaId" />
<s:hidden name="tid" />
<SPAN>
<TABLE class=box1 id=formTb cellSpacing=0 cellPadding=0>
  <TBODY>
  <TR>
    <TD class=t><B class=red>*</B>供 求： </TD>
    <TD>
	<label> <input id="type_0" class="base" type="radio" name="objtype" value='0' <s:if test="objtype==0">checked="checked"</s:if> onclick="change();"/>出售</label>&nbsp;&nbsp;&nbsp;&nbsp;  
	<label> <input id="type_1" class="base" type="radio" name="objtype" value='1' <s:if test="objtype==1">checked="checked"</s:if> onclick="change();"/>求购</label>
	</TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B> 标 题： </TD>
    <TD><s:textfield name="title" id="title" cssClass="text1" maxlength="30" /><font id="titleTip"></font></TD>
  </TR>

  <TR id=xq>
    <TD class=t><B class=red>*</B> 所在小区： </TD>
    <TD><s:textfield name="housing" id="housing" cssClass="text4" maxlength="30" /><font id="housingTip"></font></TD>
  </TR>
  <TR id='dq'>
    <TD class=t><B class=red>*</B>求购地区： </TD>
    <TD>
	<s:textfield name="zone" id="zone" cssClass="text2" maxlength="12" /><font id="zoneTip"></font> 或 <s:textfield name="zone2" id="zone3" cssClass="text2" maxlength="12" /><font id="zone2Tip"></font>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B>地铁沿线： </TD>
    <TD><s:select list="houseMetroTypeList" name="houseMetroType" id="houseMetroType" listKey="key" listValue="value"></s:select></TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B><span id="hx">户 型</span><span id="qwhx">期望户型</span>： </TD>
    <TD>
    <span id="buy">
    <s:select list="buyHouseTypeList" name="buyHouseType" id="buyHouseType" listKey="key" listValue="value"></s:select>&nbsp; 
    <s:select list="buyroomList" name="buyroom" id="buyroom" listKey="key" listValue="value"></s:select>
    </span>
    <span id="sale">
	<input id="room" name="room" class="text3" type="text" maxLength="1" <s:if test="room>0">value="<s:property value="room"/>"</s:if>/> 室 
	<input id="parlor" name="parlor" class="text3" type="text" maxLength="1" <s:if test="parlor>0">value="<s:property value="parlor"/>"</s:if>/> 厅 
	<input id="wc" name="wc" class="text3" type="text" maxLength="1" <s:if test="wc">value="<s:property value="wc"/>"</s:if>/> 卫 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	第 <input id="floor" name="floor" class="text3" type="text" maxLength="2" <s:if test="floor>0">value="<s:property value="floor"/>"</s:if>/> 层，
	共 <input id="totalfloor" name="totalfloor" class="text3" type="text" maxLength=2 <s:if test="totalfloor>0">value="<s:property value="totalfloor"/>"</s:if>/> 层
	</span>
	<font id="roomTip"></font>
	</TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B><span id="sj">售 价</span><span id="qwsj">期望价格</span>： </TD>
    <TD>
	<s:textfield name="minPrice" id="minPrice" cssClass="text3 gray" maxlength="5" />
	<span id="maxp">- &nbsp; <s:textfield name="maxPrice" id="maxPrice" cssClass="text3 gray" maxlength="5" /> </span>万元
	<span id="jzmj">建筑</span><span id="qwmj">期望</span>面积： <s:textfield name="mianji" id="mianji" cssClass="text3 gray" maxlength="5" /> 平米
	<span id="maxmj">- &nbsp; <s:textfield name="maxMianji" id="maxMianji" cssClass="text3 gray" maxlength="5" />平米</span>
	<font id="minPriceTip"></font><font id="maxPriceTip"></font><font id="mianjiTip"></font><font id="maxMianjiTip"></font>
	</TD>
  </TR>
<TR>
    <TD class=t><span id="chanquan">期望产权</span><span id="fanglin">房龄</span>： </TD>
    <TD>
	<font id="be">
	<input id="buildingEra" name="buildingEra" class="text3" type="text" <s:if test="buildingEra>0">value="<s:property value="buildingEra"/>"</s:if>/>年 &nbsp;&nbsp;&nbsp;&nbsp;
	</font>
	<s:select list="housePropertyTypeList" name="housePropertyType" id="housePropertyType" listKey="key" listValue="value"></s:select>&nbsp;
	<s:select list="houseTypeList" name="houseType" id="houseType" listKey="key" listValue="value"></s:select>&nbsp;
	<s:select list="houseFitTypeList" name="houseFitType" id="houseFitType" listKey="key" listValue="value"></s:select>&nbsp;
	<s:select list="houseTowardTypeList" name="houseTowardType" id="houseTowardType" listKey="key" listValue="value"></s:select>
	</TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B> 补充说明： </TD>
    <TD style="HEIGHT: 70px"><s:textarea id="content" rows="15" cols="70" name="content"></s:textarea><font id="contentTip"></font></TD>
 </TR>
 <TR id=pdv>
 <TD class=t valign="top">上传照片： </TD>
    <TD><div id="uploadPic"><ul>
<s:if test="photonum>0">  
<s:iterator id="p" value="%{info.photo}" >   
<li>
<input type="hidden" name="photo" value="<s:property value="#p"/>" />
<div class="displayimg"><img src="<s:property value="domain"/>/<s:property value="#p"/>"></div>
<a class="delete" href="javascript:void(0);" onclick="$(this).parent().remove();" title="删除该图片">删除该图片</a>
</li> 
</s:iterator>    
</s:if> 
    </ul></div>
	  <div id="uploader"></div>
      <span>可上传 6 张图片，每张最大2M，支持jpg/gif格式。上传图片越小，上传越快。</span><br /><img src="/images/qqjt.jpg"  border="0" /></TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B> 联系人： </TD>
    <TD>
    <s:textfield name="linkman" id="linkman" cssClass="text2" maxlength="6" /> &nbsp;
	<label><s:checkbox name="biz" id="biz" cssClass="base"></s:checkbox>我是经纪人</label>
	<span class="jingjiren" id="id_agent_tip">
		<div id="agent_tip" class="jingjirencon" style="display:none;"> 
			<span name="biz_shenfen">您已被系统判定为经纪人身份</span> 
			<p>什么是个人身份？</p> <span>1、业主直接出租/出售<br />2、个人转租</span> 
			<p>什么是经纪人身份？</p> <span>1、房产经纪公司、代理公司的经纪人(与是否有中介费无关)<br />2、二房东<br />3、进行直租/直售的物业公司、开发商</span> 
		</div> 
	</span>
	<font id="linkmanTip"></font>
	</TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B> 商家网店： </TD>
    <TD>
	<label><s:checkbox name="profile" id="profile" cssClass="base"></s:checkbox>在商家网店上显示</label>
	</TD>
  </TR>
  <TR>
    <TD class=t><B class=red>*</B> 手机或电话： </TD>
    <TD><s:textfield name="phone" id="phone" cssClass="text2" /><font id="phoneTip"></font></TD>
 </TR>
  <TR>
    <TD class=t></TD>
    <TD><input type="submit" id="fabu" class="fabu1" value="　　发布　　" ct="submit" /></TD>
 </TR>
</TBODY>
</TABLE>
<DIV class=hr_s></DIV></SPAN></FORM>
</ul>
</DIV>
<div class="content">
<s:include value="/foot.jsp" />
</div>
<script type="text/javascript">
bkLib.onDomLoaded(nicEditors.allTextAreas);
$(document).ready(function(){
	showBizTip();
	createUploader();
	$.formValidator.initConfig({formid:"update",errorfocus: true});
	$("#title").formValidator({onshow:"请输入标题",onfocus: "6-30个字，不允许填写电话和特殊符号"}).regexValidator({ regexp: "^[\\s\\S]*$", onerror: "不能填写电话和特殊符号！" }).regexValidator({ regexp: "^[\\s\\S]{6,}$", onerror: "标题不足6个字!" }).regexValidator({ regexp: "^(.){6,30}$", onerror: "标题应为6-30个字！" });
	$("#housing").formValidator({onshow:"请输入房源所在小区",onfocus: "1~30个字，不能填写电话和特殊符号"}).regexValidator({ regexp: "\\S+", onerror: "请输入房源所在小区" }).regexValidator({ regexp: "^((?!电话|手机|联系方式|号码).)*$", onerror: "小区里不能填写电话" }).regexValidator({ regexp: "^(.){1,30}$", onerror: "小区名称应为1~30个字！" });
	$("#zone").formValidator({onshow:"请输入求购地段",onfocus: "请输入求购地段"}).regexValidator({ regexp: "\\S+", onerror: "请输入求购地段" }).regexValidator({ regexp: "^(.){2,12}$", onerror: "求购地段为2-12个字" });
	$("#zone2").formValidator({onshow:"地段可以为空",onfocus: "请输入求购地段",'empty':true,onempty:"地段可以为空"}).regexValidator({ regexp: "^(.){2,12}$", onerror: "求购地段为2-12个字" });
	$("#room").formValidator({ tipid: "roomTip",onshow:"请填写户型",onfocus: "填写数字，不能是“0”。"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写户型" }).regexValidator({ regexp: "^[1-9]$", onerror: "户型必须为数字，居室不能填写0" }); 
	$("#parlor").formValidator({ tipid: "roomTip",onshow:"请填写户型",onfocus: "填写数字"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写户型" }).regexValidator({ regexp: "^[0-9]$", onerror: "户型必须为数字，居室不能填写0" }); 
	$("#wc").formValidator({ tipid: "roomTip",onshow:"请填写户型",onfocus: "填写数字"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写户型" }).regexValidator({ regexp: "^[0-9]$", onerror: "户型必须为数字，居室不能填写0" }); 
	$("#floor").formValidator({tipid: "roomTip",onshow:"请填写楼层",onfocus: "填写整数，不能是“0”。地下室用负数填写，如-3"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写楼层" }).regexValidator({ regexp: "^[1-9]\\d{0,1}$|^-\\d$", onerror: "楼层必须为数字，不能是“0”。总楼层不能是负数" }).compareValidator({ desid: "totalfloor", operateor: "<=", onerror: "总楼层不能小于所在楼层", datatype: "number" });
	$("#totalfloor").formValidator({ tipid: "roomTip",onshow:"请填写楼层",onfocus: "填写整数，不能是“0”和负数"}).regexValidator({ regexp: "^\\S+$", onerror: "请填写楼层" }).regexValidator({ regexp: "^[1-9]\\d{0,1}$", onerror: "楼层必须为数字，不能是“0”。总楼层不能是负数" }).compareValidator({ desid: "floor", operateor: ">=", onerror: "总楼层不能小于所在楼层", datatype: "number" });
	$("#minPrice").formValidator({onshow:"请输入售价",onfocus: "只能填写数字，允许一位小数"}).regexValidator({ regexp: "^\\S+$", onerror: "请输入售价" }).regexValidator({ regexp: "^[1-9]\\d{0,5}(\\.\\d{1,1})?$", onerror: "售价不能为0，允许一位小数" });
	$("#maxPrice").formValidator({onshow:"请输入售价",onfocus: "只能填写数字，允许一位小数"}).regexValidator({ regexp: "^\\S+$", onerror: "请输入售价" }).regexValidator({ regexp: "^[1-9]\\d{0,5}(\\.\\d{1,1})?$", onerror: "售价不能为0，允许一位小数" });
	$("#mianji").formValidator({onshow:"请填写面积",onfocus: "最多可填写4位大于0的整数"}).regexValidator({ regexp: "^[1-9]\\d{0,4}(\\.\\d{1,1})?$", onerror: "面积为0以外的整数，允许一位小数" });
	$("#maxMianji").formValidator({onshow:"请填写面积",onfocus: "最多可填写4位大于0的整数"}).regexValidator({ regexp: "^[1-9]\\d{0,4}(\\.\\d{1,1})?$", onerror: "面积为0以外的整数，允许一位小数" });
	$("#content").formValidator({onshow:"请填写补充说明",onfocus: "10~2000个字之间" }).regexValidator({ regexp: "^[\\s\\S]*$", onerror: "请填写房源描述" }).regexValidator({ regexp: "^[\\s\\S]{10,}$", onerror: "房源描述不足10个字" }).regexValidator({ regexp: "^([\\s\\S]){10,2000}$", onerror: "内容应在10~2000个字之间" });
	$("#phone").formValidator({onshow:"请填写电话号码",onfocus: "请正确填写电话号码"}).regexValidator({ regexp: "(^(0\\d{2,3})?-?([2-9]\\d{6,7})(-\\d{1,5})?$)|(^((\\(\\d{3}\\))|(\\d{0}))?(13|14|15|18)\\d{9}$)|(^(400|800)\\d{7}(-\\d{1,4})?$)|(^(95013)\\d{6,8}$)", onerror: "电话填写错误。请参照格式填写：876543211或138********" });
	$('#linkman').formValidator({onshow:"请输入联系人",onfocus:'2～6个字，不能填写电话和特殊符号'}).regexValidator({ regexp: "\\S+", onerror: "请输入联系人" }).regexValidator({ regexp: "^(.){2,6}$", onerror: "联系人不足2个字" }).regexValidator({ regexp: "^[\\w\\d\\s\\u4e00-\\u9fa5]*$", onerror: "联系人不能填写特殊符号" });
	void function(){ 
	$(':radio[name="objtype"][value="<s:property value="objtype"/>"]').get(0).checked = true;   
	showWoshi(); 
	}();
	
});
function showWoshi(){
	var obj = $(':radio[name="objtype"][value="0"]').get(0); 
	if(obj){ if(obj.checked){ 
		$('#xq').show(); //小区
		$('#dq').hide(); //求购地区
		$('#hx').show(); //户型
		$('#sale').show(); //卖
		$('#qwhx').hide(); //期望户型
		$('#buy').hide(); //买
		$('#sj').show(); //售价
		$('#qwsj').hide(); //期望售价
		$('#maxp').hide(); //大售价input
		$('#jzmj').show(); //建筑面积
		$('#qwmj').hide(); //期待面积
		$('#maxmj').hide(); //大面积input
		$('#fanglin').show(); //房龄
		$('#chanquan').hide(); //期望产权
		$('#be').show(); //年
		$('#houseType').show(); //房子类型
		$('#fitType').show(); //装修类型
		$('#toward').show(); //朝向
		$('#pdv').show(); //朝向
		$("#housing").unFormValidator(false); //所在小区
		$("#zone").unFormValidator(true); //求购地区
		$("#zone2").unFormValidator(true); //求购地区
		$("#room").unFormValidator(false); //室
		$("#parlor").unFormValidator(false); //厅
		$("#wc").unFormValidator(false); //卫
		$("#floor").unFormValidator(false); //层
		$("#totalfloor").unFormValidator(false); //总层
		$("#maxPrice").unFormValidator(true); //求购地区
		$("#maxMianji").unFormValidator(true); //最大面积
	} else { 
		$('#xq').hide();
		$('#dq').show(); 

		$('#hx').hide(); //户型
		$('#sale').hide(); //卖
		$('#qwhx').show(); //期望户型
		$('#buy').show(); //买
		$('#sj').hide(); //售价
		$('#qwsj').show(); //期望售价
		$('#maxp').show(); //大售价input
		$('#jzmj').hide(); //建筑面积
		$('#qwmj').show(); //期待面积
		$('#maxmj').show(); //大面积input
		$('#fanglin').hide(); //房龄
		$('#chanquan').show(); //期望产权
		$('#be').hide(); //年
		$('#houseType').hide(); //房子类型
		$('#fitType').hide(); //装修类型
		$('#toward').hide(); //朝向
		$('#pdv').hide(); //朝向
		$("#housing").unFormValidator(true); //所在小区
		$("#zone").unFormValidator(false); //求购地区
		$("#zone2").unFormValidator(false); //求购地区
		$("#room").unFormValidator(true); //室
		$("#parlor").unFormValidator(true); //厅
		$("#wc").unFormValidator(true); //卫
		$("#floor").unFormValidator(true); //层
		$("#totalfloor").unFormValidator(true); //总层
		$("#maxPrice").unFormValidator(false); //求购地区
		$("#maxMianji").unFormValidator(false); //最大面积
	} 
} 
} 
function change(){showWoshi();}
function showBizTip(){
	var cbx = $(':checkbox[name="isBiz"]'); 
	if(cbx.attr('disabled')){
		cbx.parent().hide(); 
		cbx.parent().after('<font color="red">经纪人</font>');
	} else { 
		$('span[name="biz_shenfen"]').hide(); 
	} 
	$("#id_agent_tip").hover(function(){ $('#agent_tip').css('display',''); }, function(){ $('#agent_tip').css('display','none'); } ); 
} 
function createUploader(){            
	var uploader = new qq.FileUploader({
	element: document.getElementById('uploader'),
	action: '<s:property value="domain"/>/upPhoto.action?action=infoPic',
	allowedExtensions:['jpg','gif','jpeg']
    });           
}
</script>
</body>
</html>